package org.grayrabbit.cms.entity;

// Generated 2012-1-5 15:59:28 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * CmsPublishLog generated by hbm2java
 */
@Entity
@Table(name = "CMS_PUBLISH_LOG")
public class PublishLog implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String publishLogId;
	private PublishTask publishTask;
	private Date publishTime;
	private String publishStatus;
	private String publishInfo;
	private String publishType;
	private String objectId;
	private String templatePath;
	private String htmlPath;
	private Boolean isError;

	 
	@Id
	@Column(name = "PUBLISH_LOG_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid") 
	public String getPublishLogId() {
		return this.publishLogId;
	}

	public void setPublishLogId(String publishLogId) {
		this.publishLogId = publishLogId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TASK_ID")
	public PublishTask getPublishTask() {
		return this.publishTask;
	}

	public void setPublishTask(PublishTask publishTask) {
		this.publishTask = publishTask;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "PUBLISH_TIME", length = 7)
	public Date getPublishTime() {
		return this.publishTime;
	}

	public void setPublishTime(Date publishTime) {
		this.publishTime = publishTime;
	}

	@Column(name = "PUBLISH_STATUS", length = 32)
	public String getPublishStatus() {
		return this.publishStatus;
	}

	@Transient
	public boolean isFinished(){
		if("2".equals(publishStatus))
			return true;
		return false;
	}
	public void setPublishStatus(String publishStatus) {
		this.publishStatus = publishStatus;
	}

	@Column(name = "PUBLISH_INFO", length = 4000)
	public String getPublishInfo() {
		return this.publishInfo;
	}

	public void setPublishInfo(String publishInfo) {
		this.publishInfo = publishInfo;
	}

	@Column(name = "PUBLISH_TYPE", length = 32)
	public String getPublishType() {
		return this.publishType;
	}

	public void setPublishType(String publishType) {
		this.publishType = publishType;
	}

	@Column(name = "OBJECT_ID", length = 32)
	public String getObjectId() {
		return this.objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	@Column(name = "TEMPLATE_PATH", length = 256)
	public String getTemplatePath() {
		return this.templatePath;
	}

	public void setTemplatePath(String templatePath) {
		this.templatePath = templatePath;
	}

	@Column(name = "HTML_PATH", length = 256)
	public String getHtmlPath() {
		return this.htmlPath;
	}

	public void setHtmlPath(String htmlPath) {
		this.htmlPath = htmlPath;
	}

	@Column(name = "IS_ERROR", precision = 1, scale = 0)
	public Boolean getIsError() {
		return this.isError;
	}

	public void setIsError(Boolean isError) {
		this.isError = isError;
	}

}
